<?php
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
$sql="select * from article";
$arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
?>
<table border="1">
    <tr>
        <td>编号</td>
        <td>文章标题</td>
        <td>文章内容</td>
    </tr>
    <?php foreach($arr as $key=>$value) { ?>
        <tr>
            <td><?php echo $value['id']?></td>
            <td><?php echo $value['news_title']?></td>
            <td><?php echo $value['news_content']?></td>
        </tr>
    <?php } ?>
</table>
